package logtest

import (
	"go.uber.org/zap"
	"k8soperation/global"
	"strings"
	"time"
)

// FloodLogs 会快速写满日志文件，触发 lumberjack 轮转
func FloodLogs() {
	big := strings.Repeat("X", 300*1024) // 300KB
	for i := 0; i < 10; i++ {
		global.Logger.Info("rotate-check", zap.Int("i", i), zap.String("payload", big))
		time.Sleep(20 * time.Millisecond)
	}
}
